Closed Bug 565605 Opened 15 years ago Closed 11 years ago

crash [@ js::ReportStrictModeError] if !ts

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity, crash)

Attachments

(1 file)

627 js::ReportStrictModeError(JSContext *cx, TokenStream *ts, JSTreeContext *tc, JSParseNode *pn, 628 uintN errorNumber, ...) 630 JS_ASSERT(ts || tc); 635 if ((tc && tc->flags & TCF_STRICT_MODE_CODE) || (ts && ts->isStrictMode())) 636 flags = JSREPORT_ERROR; 644 bool result = ts->reportCompileErrorNumberVA(pn, flags, errorNumber, ap); The code seems perfectly happy with only a tc in line 630 and line 635, but at line 644 it changed its mind...
Blocks: 549658
Attached patch patchSplinter Review
Assignee: general → timeless
Status: NEW → ASSIGNED
Attachment #445082 - Flags: review?(brendan)
Attachment #445082 - Flags: review?(brendan) → review?(jim)
Comment on attachment 445082 [details] [diff] [review] patch Seems reasonable. I agree the code is incoherent.
Attachment #445082 - Flags: review?(jimb) → review+
There isn't any way to actually get this to crash, though, is there? It seems like all callers do pass a 'ts'.
Seems like ReportStrictModeError should be js::TokenStream::reportStrictModeError (an instance method). /be
if all callers pass ts, then there's no way to crash. the code as written with no understanding of callers could crash while it's making its second assertion. i stand by my bug summary as it's correct. but i've removed the keyword and adjusted the severity. if someone wants to do more work, i respectfully request they land this and then use their own bug to do further work. they're free to reference the bug number for that additional work here.
Severity: critical → enhancement
Keywords: crashcheckin-needed
Keywords: checkin-needed
Whiteboard: [timeless: need unrotted patch]
I find no current crashes containing js::ReportStrictModeError
AFAICT, this patch is no longer relevant because js::ReportStrictModeError is now a member function js::TokenStream::reportStrictModeError.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Keywords: crash
Resolution: --- → WORKSFORME
Whiteboard: [timeless: need unrotted patch]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: